/*
 * @FilePath: \undefinedc:\Users\sxjct\.leetcode\1603.设计停车系统.cpp
 * @Brief: 
 * @Version: 1.0
 * @Date: 2021-03-19 10:15:22
 * @Author: tianyiyi
 * @Copyright: Copyright@tianyiyi
 * @LastEditors: Mr.Tian
 * @LastEditTime: 2021-03-19 10:32:27
 */
/*
 * @lc app=leetcode.cn id=1603 lang=cpp
 *
 * [1603] 设计停车系统
 */

// @lc code=start
class ParkingSystem {
public:
    ParkingSystem(int big, int medium, int small) {
        big_CarType = big;
        medium_CarType = medium;
        small_CarType = small;
    }
    
    bool addCar(int carType) {
        switch(carType)
        {
            case 1:{
                if(big_CarType > 0)
                {
                    big_CarType--;
                    return true;
                }
                break;
            }
            case 2:{
                if(medium_CarType > 0)
                {
                    medium_CarType--;
                    return true;
                }
                break;
            }
            case 3:{
                if(small_CarType > 0)
                {
                    small_CarType--;
                    return true;
                }
                break;
            }
            default:
                return false;
        }
        return false;
    }
private:
    int big_CarType;
    int medium_CarType;
    int small_CarType;
};

/**
 * Your ParkingSystem object will be instantiated and called as such:
 * ParkingSystem* obj = new ParkingSystem(big, medium, small);
 * bool param_1 = obj->addCar(carType);
 */
// @lc code=end

